<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>latinodances <?php echo (isset($page_title))?' :: '.$page_title:''; ?></title>

<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" media='screen,print' />
</head>

<body>

<div style="font-size:12px; font-family:arial, verdana, sans-serif;">
    	<?php if ($this->config->item('site_logo')) :?>
	<div>
		<img src="<?php echo base_url($this->config->item('site_logo'));?>" />
	</div>
	<?php endif; ?>
    <div class="pull-right"><a HREF="javascript:window.print()" class="btn"><i class="icon-print"></i></a></div>
	
    <table width:100%; font-size:13px;" cellpadding="5" cellspacing="0">
        <tr>
            <td style="width:20%; vertical-align:top;" class="packing">
                <h2 style="margin:0px">*<?php echo $order->order_number;?>*</h2>
                <?php if(!empty($order->is_gift)):?>
                    <h1 style="margin:0px; font-size:4em;"><?php echo lang('packing_is_gift');?></h1>
                <?php endif;?>
            </td>
            <td style="width:40%; vertical-align:top;">
                <strong><?php echo lang('bill_to_address');?></strong><br/>
                 <?php echo (!empty($order->bill_company))?$order->bill_company.'<br/>':'';?>
                <?php echo $order->bill_firstname.' '.$order->bill_lastname;?> <br/>
                <?php echo $order->bill_address1;?><br>
                <?php echo (!empty($order->bill_address2))?$order->bill_address2.'<br/>':'';?>
                <?php echo $order->bill_city.', '.$order->bill_zone.' '.$order->bill_zip;?><br/>
                <?php echo $order->bill_country;?><br/>

                <?php echo $order->bill_email;?><br/>
                <?php echo $order->bill_phone;?>

            </td>
            <td style="width:40%; vertical-align:top;" class="packing">
                <strong><?php echo lang('ship_to_address');?></strong><br/>     
                <?php echo (!empty($order->ship_company))?$order->ship_company.'<br/>':'';?>
                <?php echo $order->ship_firstname.' '.$order->ship_lastname;?> <br/>
                <?php echo $order->ship_address1;?><br>
                <?php echo (!empty($order->ship_address2))?$order->ship_address2.'<br/>':'';?>
                <?php echo $order->ship_city.', '.$order->ship_zone.' '.$order->ship_zip;?><br/>
                <?php echo $order->ship_country;?><br/>

                <?php echo $order->ship_email;?><br/>
                <?php echo $order->ship_phone;?>

            <br/>
            </td>
        </tr>
        
        <tr>
            <td></td>
            <td>
                <strong><?php echo lang('payment_method');?></strong>
                <?php echo $order->payment_info; ?>
            </td>
            <td>
                <strong><?php echo lang('shipping_details');?></strong>
                <?php echo $order->shipping_method; ?>
            </td>
        </tr>
        
        <?php if(!empty($order->gift_message)):?>
        <tr>
            <td colspan="3">
                <strong><?php echo lang('gift_note');?></strong>
                <?php echo $order->gift_message;?>
            </td>
        </tr>
        <?php endif;?>
        
        <?php if(!empty($order->shipping_notes)):?>
            <tr>
                <td colspan="3">
                    <strong><?php echo lang('shipping_notes');?></strong><br/><?php echo $order->shipping_notes;?>
                </td>
            </tr>
        <?php endif;?>
    </table>
    
    <table border="1" style="width:100%; margin-top:10px; border-color:#000; font-size:13px; border-collapse:collapse;" cellpadding="5" cellspacing="0">
        <thead>
            <tr>
                <th width="5%" class="packing">
                    <?php echo lang('qty');?>
                </th>
                <th width="20%" class="packing">
                    <?php echo lang('name');?>
                </th>
                <th class="packing" >
                    <?php echo lang('description');?>
                </th>
            </tr>
        </thead>
    <?php $items = $order->contents; ?>


<?php 
$colors =array(
		"000000"=>"Black",
		"000080"=>"Navy",
		"0000FF"=>"Blue",
		"002147"=>"Bleu marine",
		"002395"=>"Dark blue",
		"006400"=>"Dark Green",
		"008000"=>"Office green",
		"008080"=>"Teal",
		"00A86B"=>"Jade",
		"00FF7F"=>"Spring Green",
		"00FFFF"=>"Cyan",
		"123524"=>"Phthalo Green",
		"138808"=>"India green",
		"1E90FF"=>"Dodger Blue",
		"32CD32"=>"Green",
		"32CD32"=>"Lime Green",
		"3D2B1F"=>"Noir",
		"3EB489"=>"Mint Leaf",
		"40E0D0"=>"turquoise",
		"6495ED"=>"Cornflower blue",
		"66FF00"=>"Bright green",
		"6F00FF"=>"Indigo",
		"78184A"=>"dark purple",
		"800000"=>"Bordeaux",
		"800080"=>"Bright purple",
		"800080"=>"purple",
		"808080"=>"Grey",
		"882D17"=>"Chocola",
		"8B0000"=>"DarkRed",
		"8DB600"=>"Apple Green",
		"8F00FF"=>"Violet",
		"9400D3"=>"Dark Violet",
		"967117"=>"beige foncé",
		"9966CC"=>"Amethyst",
		"A9A9A9"=>"Dark grey",
		"AAF0D1"=>"Magic Mint",
		"ACACAC"=>"Pewter",
		"ADD8E6"=>"Light Blue",
		"AE6838"=>"Tan2",
		"B57EDC"=>"Lavender",
		"BD33A4"=>"Byzantine",
		"BFFF00"=>"Lime",
		"C0C0C0"=>"Silver",
		"C71585"=>"Red violet",
		"CCFF00"=>"Jaune citron",
		"D2B48C"=>"Tan1",
		"D3D3D3"=>"Light gray",
		"D4AF37"=>"Gold",
		"DA70D6"=>"Orchid",
		"DE3163"=>"Cerise",
		"E62020"=>"True red",
		"E6E6FA"=>"Light violet",
		"E75480"=>"Dark pink",
		"F2BDCD"=>"Orchid pink",
		"F3E5AB"=>"Vanilla",
		"F4F0EC"=>"Offwhite",
		"F5F5DC"=>"Beige",
		"F5F5F5"=>"White smoke",
		"FA8072"=>"Salmon",
		"FAD6A5"=>"champange",
		"FF0000"=>"Bright red",
		"FF007F"=>"Rose",
		"FF00FF"=>"Fuchsia",
		"FF1493"=>"Fuchsia fluo",
		"FF3F00"=>"Orange red",
		"FF4F00"=>"Orange fluo",
		"FF5349"=>"Red orange",
		"FF69B4"=>"Hot pink",
		"FF7F00"=>"Orange",
		"FF7F50"=>"Coral",
		"FFB6C1"=>"Light pink",
		"FFD700"=>"Gold",
		"FFFDD0"=>"Cream",
		"FFFF00"=>"Yellow",
		"FFFFF0"=>"Ivory",
		"FFFFFF"=>"White"
);

foreach($order->contents as $orderkey=>$product):
        $img_count = 1;
?>
        <tr>
            <td class="packing" style="font-size:20px; font-weight:bold;">
                <?php echo $product['quantity'];?>
            </td>
            <td class="packing">
                <?php echo $product['name'];?>
                <?php echo (trim($product['sku']) != '')?'<br/><small>sku: '.$product['sku'].'</small>':'';?>
            </td>
            <td class="packing">
                <?php

                if(isset($product['color']) and $product['color']!='') {
                	$color='';
                	if(isset($colors[$product['color']]))$color=$colors[$product['color']];
                	echo "Color: <small class='btn' style='background:#{$product['color']}'>".$color."</small>";
                }
                
                if(isset($product['stone']) and $product['stone'])
                	echo "<br/> Stone: ".format_currency($stone=$product['stone']);
                // Print options
                if(isset($product['cm']) and !empty($product['cm'])){
                	echo " <br/>Size: <small>";
                	foreach($product['cm'] as $name=>$cm){
                		echo "<b>".str_replace('_', ' ',$name).":</b> {$cm}cm | ";
                
                	}
                	echo "</small>";
                }
                
                if(isset($product['note']) and $product['note']!='') echo "<br/> Note: <small>".$product['note']."</small>";
                
                if(isset($product['options']))
                {
                    foreach($product['options'] as $name=>$value)
                    {
                        $name = explode('-', $name);
                        $name = trim($name[0]);
                        if(is_array($value))
                        {
                            echo '<div>'.$name.':<br/>';
                            foreach($value as $item)
                            {
                                echo '- '.$item.'<br/>';
                            }   
                            echo "</div>";
                        }
                        else
                        {
                            echo '<div>'.$name.': '.$value.'</div>';
                        }
                    }
                }

                ?>
            </td>
        </tr>
<?php   endforeach;?>
    </table>
</div>
</body>
</html>